package com.socialsoftware.MediaCommunication.model;

/**
 *  此枚举类代表不同模式的通信方式
 */
public enum CallMode {
    VIDEO("video"),
    AUDIO("audio"),
    SCREEN("screen");

    private final String value;

    CallMode(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static CallMode fromString(String text) {
        if (text == null) {
            throw new IllegalArgumentException("通信模式不能为空");
        }
        
        for (CallMode mode : CallMode.values()) {
            if (mode.value.equalsIgnoreCase(text)) {
                return mode;
            }
        }
        
        throw new IllegalArgumentException("未知的通信模式: " + text);
    }
} 